/**
 * SiC B2B2C Shop 使用 木兰公共许可证,第2版（Mulan PubL v2） 开源协议，请遵守相关条款，或者联系sicheng.net获取商用授权书。
 * Copyright (c) 2016 SiCheng.Net
 * SiC B2B2C Shop is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.sicheng.common.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>标题: MIMEType</p>
 * <p>描述: </p>
 * <p>公司: 思程科技 www.sicheng.net</p>
 *
 * @author zhaolei
 * @date 2017年10月17日 上午9:33:11
 */
public class MIMEType {

    public static final Map<String, String> types = new HashMap<String, String>() {{

//		put("js","application/javascript");;
        put("js", "text/javascript");
        ;
        put("csv", "text/comma-separated-values");
        ;
        put("css", "text/css");
        ;
        put("htm", "text/html");
        ;
        put("html", "text/html");
        ;
        put("json", "application/json");

        put("ez", "application/andrew-inset");
        ;
        put("tsp", "application/dsptype");
        ;
        put("spl", "application/futuresplash");
        ;
        put("hta", "application/hta");
        ;
        put("hqx", "application/mac-binhex40");
        ;
        put("cpt", "application/mac-compactpro");
        ;
        put("nb", "application/mathematica");
        ;
        put("mdb", "application/msaccess");
        ;
        put("oda", "application/oda");
        ;
        put("ogg", "application/ogg");
        ;
        put("pdf", "application/pdf");
        ;
        put("key", "application/pgp-keys");
        ;
        put("pgp", "application/pgp-signature");
        ;
        put("prf", "application/pics-rules");
        ;
        put("rar", "application/rar");
        ;
        put("rdf", "application/rdf+xml");
        ;
        put("rss", "application/rss+xml");
        ;
        put("zip", "application/zip");
        ;
        put("apk", "application/vnd.android.package-archive");
        ;
        put("cdy", "application/vnd.cinderella");
        ;
        put("stl", "application/vnd.ms-pki.stl");
        ;
        put("odb", "application/vnd.oasis.opendocument.database");
        ;
        put("odf", "application/vnd.oasis.opendocument.formula");
        ;
        put("odg", "application/vnd.oasis.opendocument.graphics");
        ;
        put("otg", "application/vnd.oasis.opendocument.graphics-template");
        ;
        put("odi", "application/vnd.oasis.opendocument.image");
        ;
        put("ods", "application/vnd.oasis.opendocument.spreadsheet");
        ;
        put("ots", "application/vnd.oasis.opendocument.spreadsheet-template");
        ;
        put("odt", "application/vnd.oasis.opendocument.text");
        ;
        put("odm", "application/vnd.oasis.opendocument.text-master");
        ;
        put("ott", "application/vnd.oasis.opendocument.text-template");
        ;
        put("oth", "application/vnd.oasis.opendocument.text-web");
        ;
        put("kml", "application/vnd.google-earth.kml+xml");
        ;
        put("kmz", "application/vnd.google-earth.kmz");
        ;
        put("doc", "application/msword");
        ;
        put("dot", "application/msword");
        ;
        put("docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
        ;
        put("dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template");
        ;
        put("xls", "application/vnd.ms-excel");
        ;
        put("xlt", "application/vnd.ms-excel");
        ;
        put("xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
        ;
        put("xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template");
        ;
        put("ppt", "application/vnd.ms-powerpoint");
        ;
        put("pot", "application/vnd.ms-powerpoint");
        ;
        put("pps", "application/vnd.ms-powerpoint");
        ;
        put("pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation");
        ;
        put("potx", "application/vnd.openxmlformats-officedocument.presentationml.template");
        ;
        put("ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow");
        ;
        put("cod", "application/vnd.rim.cod");
        ;
        put("mmf", "application/vnd.smaf");
        ;
        put("sdc", "application/vnd.stardivision.calc");
        ;
        put("sda", "application/vnd.stardivision.draw");
        ;
        put("sdd", "application/vnd.stardivision.impress");
        ;
        put("sdp", "application/vnd.stardivision.impress");
        ;
        put("smf", "application/vnd.stardivision.math");
        ;
        put("sdw", "application/vnd.stardivision.writer");
        ;
        put("vor", "application/vnd.stardivision.writer");
        ;
        put("sgl", "application/vnd.stardivision.writer-global");
        ;
        put("sxc", "application/vnd.sun.xml.calc");
        ;
        put("stc", "application/vnd.sun.xml.calc.template");
        ;
        put("sxd", "application/vnd.sun.xml.draw");
        ;
        put("std", "application/vnd.sun.xml.draw.template");
        ;
        put("sxi", "application/vnd.sun.xml.impress");
        ;
        put("sti", "application/vnd.sun.xml.impress.template");
        put("sxm", "application/vnd.sun.xml.math");
        put("sxw", "application/vnd.sun.xml.writer");
        put("sxg", "application/vnd.sun.xml.writer.global");
        put("stw", "application/vnd.sun.xml.writer.template");
        put("vsd", "application/vnd.visio");
        put("abw", "application/x-abiword");
        put("dmg", "application/x-apple-diskimage");
        put("bcpio", "application/x-bcpio");
        put("torrent", "application/x-bittorrent");
        put("cdf", "application/x-cdf");
        put("vcd", "application/x-cdlink");
        put("pgn", "application/x-chess-pgn");
        put("cpio", "application/x-cpio");
        put("deb", "application/x-debian-package");
        put("udeb", "application/x-debian-package");
        put("dcr", "application/x-director");
        put("dir", "application/x-director");
        put("dxr", "application/x-director");
        put("dms", "application/x-dms");
        put("wad", "application/x-doom");
        put("dvi", "application/x-dvi");
        put("flac", "application/x-flac");
        put("pfa", "application/x-font");
        put("pfb", "application/x-font");
        put("gsf", "application/x-font");
        put("pcf", "application/x-font");
        put("pcf.z", "application/x-font");
        put("mm", "application/x-freemind");
        put("spl", "application/x-futuresplash");
        put("gnumeric", "application/x-gnumeric");
        put("sgf", "application/x-go-sgf");
        put("gcf", "application/x-graphing-calculator");
        put("gtar", "application/x-gtar");
        put("tgz", "application/x-gtar");
        put("taz", "application/x-gtar");
        put("hdf", "application/x-hdf");
        put("ica", "application/x-ica");
        put("ins", "application/x-internet-signup");
        put("isp", "application/x-internet-signup");
        put("iii", "application/x-iphone");
        put("iso", "application/x-iso9660-image");
        put("jmz", "application/x-jmol");
        put("chrt", "application/x-kchart");
        put("kil", "application/x-killustrator");
        put("skp", "application/x-koan");
        put("skd", "application/x-koan");
        put("skt", "application/x-koan");
        put("skm", "application/x-koan");
        put("kpr", "application/x-kpresenter");
        put("kpt", "application/x-kpresenter");
        put("ksp", "application/x-kspread");
        put("kwd", "application/x-kword");
        put("kwt", "application/x-kword");
        put("latex", "application/x-latex");
        put("lha", "application/x-lha");
        put("lzh", "application/x-lzh");
        put("lzx", "application/x-lzx");
        put("frm", "application/x-maker");
        put("maker", "application/x-maker");
        put("frame", "application/x-maker");
        put("fb", "application/x-maker");
        put("book", "application/x-maker");
        put("fbdoc", "application/x-maker");
        put("mif", "application/x-mif");
        put("wmd", "application/x-ms-wmd");
        put("wmz", "application/x-ms-wmz");
        put("msi", "application/x-msi");
        put("pac", "application/x-ns-proxy-autoconfig");
        put("nwc", "application/x-nwc");
        put("o", "application/x-object");
        put("oza", "application/x-oz-application");
        put("p12", "application/x-pkcs12");
        put("p7r", "application/x-pkcs7-certreqresp");
        put("crl", "application/x-pkcs7-crl");
        put("qtl", "application/x-quicktimeplayer");
        put("shar", "application/x-shar");
        put("swf", "application/x-shockwave-flash");
        put("sit", "application/x-stuffit");
        put("sv4cpio", "application/x-sv4cpio");
        put("sv4crc", "application/x-sv4crc");
        put("tar", "application/x-tar");
        put("texinfo", "application/x-texinfo");
        put("texi", "application/x-texinfo");
        put("t", "application/x-troff");
        put("roff", "application/x-troff");
        put("man", "application/x-troff-man");
        put("ustar", "application/x-ustar");
        put("src", "application/x-wais-source");
        put("wz", "application/x-wingz");
        put("webarchive", "application/x-webarchive");
        put("webarchivexml", "application/x-webarchive-xml");
        put("crt", "application/x-x509-ca-cert");
        put("crt", "application/x-x509-user-cert");
        put("xcf", "application/x-xcf");
        put("fig", "application/x-xfig");
        put("xhtml", "application/xhtml+xml");
        put("3gpp", "audio/3gpp");
        put("amr", "audio/amr");
        put("snd", "audio/basic");
        put("mid", "audio/midi");
        put("midi", "audio/midi");
        put("kar", "audio/midi");
        put("xmf", "audio/midi");
        put("mxmf", "audio/mobile-xmf");
        put("mpga", "audio/mpeg");
        put("mpega", "audio/mpeg");
        put("mp2", "audio/mpeg");
        put("mp3", "audio/mpeg");
        put("m4a", "audio/mpeg");
        put("m3u", "audio/mpegurl");
        put("sid", "audio/prs.sid");
        put("aif", "audio/x-aiff");
        put("aiff", "audio/x-aiff");
        put("aifc", "audio/x-aiff");
        put("gsm", "audio/x-gsm");
        put("m3u", "audio/x-mpegurl");
        put("wma", "audio/x-ms-wma");
        put("wax", "audio/x-ms-wax");
        put("ra", "audio/x-pn-realaudio");
        put("rm", "audio/x-pn-realaudio");
        put("ram", "audio/x-pn-realaudio");
        put("ra", "audio/x-realaudio");
        put("pls", "audio/x-scpls");
        put("sd2", "audio/x-sd2");
        put("wav", "audio/x-wav");
        put("bmp", "image/bmp");
        put("qcp", "audio/x-qcp");
        put("gif", "image/gif");
        put("cur", "image/ico");
        put("ico", "image/ico");
        put("ief", "image/ief");
        put("jpeg", "image/jpeg");
        put("jpg", "image/jpeg");
        put("jpe", "image/jpeg");
        put("pcx", "image/pcx");
        put("png", "image/png");
        put("svg", "image/svg+xml");
        put("svgz", "image/svg+xml");
        put("tiff", "image/tiff");
        put("tif", "image/tiff");
        put("djvu", "image/vnd.djvu");
        put("djv", "image/vnd.djvu");
        put("wbmp", "image/vnd.wap.wbmp");
        put("ras", "image/x-cmu-raster");
        put("cdr", "image/x-coreldraw");
        put("pat", "image/x-coreldrawpattern");
        put("cdt", "image/x-coreldrawtemplate");
        put("cpt", "image/x-corelphotopaint");
        put("ico", "image/x-icon");
        put("art", "image/x-jg");
        put("jng", "image/x-jng");
        put("psd", "image/x-photoshop");
        put("pnm", "image/x-portable-anymap");
        put("pbm", "image/x-portable-bitmap");
        put("pgm", "image/x-portable-graymap");
        put("ppm", "image/x-portable-pixmap");
        put("rgb", "image/x-rgb");
        put("xbm", "image/x-xbitmap");
        put("xpm", "image/x-xpixmap");
        put("xwd", "image/x-xwindowdump");
        put("igs", "model/iges");
        put("iges", "model/iges");
        put("msh", "model/mesh");
        put("mesh", "model/mesh");
        put("silo", "model/mesh");
        put("ics", "text/calendar");
        put("icz", "text/calendar");
        put("323", "text/h323");
        put("uls", "text/iuls");
        put("mml", "text/mathml");
        put("txt", "text/plain");
        put("asc", "text/plain");
        put("text", "text/plain");
        put("diff", "text/plain");
        put("po", "text/plain");
        put("rtx", "text/richtext");
        put("rtf", "text/rtf");
        put("ts", "text/texmacs");
        put("phps", "text/text");
        put("tsv", "text/tab-separated-values");
        put("xml", "text/xml");
        put("bib", "text/x-bibtex");
        put("boo", "text/x-boo");
        put("h++", "text/x-c++hdr");
        put("hpp", "text/x-c++hdr");
        put("hxx", "text/x-c++hdr");
        put("hh", "text/x-c++hdr");
        put("c++", "text/x-c++src");
        put("cpp", "text/x-c++src");
        put("cxx", "text/x-c++src");
        put("h", "text/x-chdr");
        put("htc", "text/x-component");
        put("csh", "text/x-csh");
        put("c", "text/x-csrc");
        put("d", "text/x-dsrc");
        put("hs", "text/x-haskell");
        put("java", "text/x-java");
        put("lhs", "text/x-literate-haskell");
        put("moc", "text/x-moc");
        put("p", "text/x-pascal");
        put("pas", "text/x-pascal");
        put("gcd", "text/x-pcs-gcd");
        put("etx", "text/x-setext");
        put("tcl", "text/x-tcl");
        put("tex", "text/x-tex");
        put("ltx", "text/x-tex");
        put("sty", "text/x-tex");
        put("cls", "text/x-tex");
        put("vcs", "text/x-vcalendar");
        put("vcf", "text/x-vcard");
        put("3gpp", "video/3gpp");
        put("3gp", "video/3gpp");
        put("3g2", "video/3gpp");
        put("dl", "video/dl");
        put("dif", "video/dv");
        put("dv", "video/dv");
        put("fli", "video/fli");
        put("m4v", "video/m4v");
        put("mpeg", "video/mpeg");
        put("mpg", "video/mpeg");
        put("mpe", "video/mpeg");
        put("mp4", "video/mp4");
        put("vob", "video/mpeg");
        put("qt", "video/quicktime");
        put("mov", "video/quicktime");
        put("mxu", "video/vnd.mpegurl");
        put("webm", "video/webm");
        put("lsf", "video/x-la-asf");
        put("lsx", "video/x-la-asf");
        put("mng", "video/x-mng");
        put("asf", "video/x-ms-asf");
        put("asx", "video/x-ms-asf");
        put("wm", "video/x-ms-wm");
        put("wmv", "video/x-ms-wmv");
        put("wmx", "video/x-ms-wmx");
        put("wvx", "video/x-ms-wvx");
        put("avi", "video/x-msvideo");
        put("movie", "video/x-sgi-movie");
        put("ice", "x-conference/x-cooltalk");
        put("sisx", "x-epoc/x-sisx-app");
    }};

    public static String getMIMEType(String suffix) {
        if (suffix == null) {
            return null;
        }
        return MIMEType.types.get(suffix.toLowerCase());
    }

}
